<!DOCTYPE html>
<html>

<head>
    <meta charset='utf-8' />
    <title>Add a third party vector tile source</title>
    <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
    <script src='./mapbox/mapbox-gl.js'></script>
    <link href='./mapbox/mapbox-gl.css' rel='stylesheet' />
    <style>
        body {
            margin: 0;
            padding: 0;
        }
        
        #map {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 100%;
        }
    </style>
</head>

<body>

    <div id='map'></div>
    <script>
        mapboxgl.accessToken = 'pk.eyJ1IjoicG9sb25nIiwiYSI6ImNpeHlxYWNrcDAwNmEzMnBtNDVkcTA4N2sifQ.tk1D45z7srDUAXg4X9foUw';
        var tileset = 'mapbox.streets';
        var map = new mapboxgl.Map({
            container: 'map',
            zoom: 12,
            center: [125, 32],
            style: 'mapbox://styles/mapbox/light-v9',
            hash: false
        });

        map.on('load', function loaded() {
            map.addSource('custom-go-vector-tile-source', {
                type: 'vector',
                tiles: ['http://localhost:8050/zgis/vector/tile/{z}/{x}/{y}']
            });
            map.addLayer({
                id: 'background',
                type: 'background',
                paint: {
                    'background-color': 'black'
                }
            });
            map.addLayer({
                "id": "custom-go-vector-tile-layer",
                "type": "circle",
                "source": "custom-go-vector-tile-source",
                "source-layer": "points",
                paint: {
                    'circle-radius': {
                        stops: [
                            [8, 0.1],
                            [11, 0.5],
                            [15, 3],
                            [20, 60]
                        ]
                    },
                    'circle-color': '#2a55b9',
                    'circle-opacity': 1
                }
            });
        });
    </script>

</body>

</html>